Skip to content

Proto: add "battery status" to channel state info.#607

Open
klew wants to merge 3 commits into
SUPLA:developfrom
klew:develop
Open

Proto: add "battery status" to channel state info.#607
klew wants to merge 3 commits into
SUPLA:developfrom
klew:develop

Conversation

@klew
Copy link
Copy Markdown
Member

@klew klew commented May 19, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bae98cd032

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread supla-common/proto.h
Comment on lines +2686 to +2689
#define SUPLA_CHANNELSTATE_FIELD_BATTERY_STATE 0x20000
// Device battery state is used to inform server that channel's battery state
// should be applied to whole device
#define SUPLA_CHANNELSTATE_FIELD_DEVICE_BATTERY_STATE 0x40000
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Persist the new battery-state flags

When a device sets SUPLA_CHANNELSTATE_FIELD_BATTERY_STATE or SUPLA_CHANNELSTATE_FIELD_DEVICE_BATTERY_STATE, the server receives the raw TDSC_ChannelState, but the persistence path serializes channel state through supla_channel_state::get_json() before supla_device_dao::update_channel_state, and that JSON code only handles batteryHealth / deviceBatteryLevel today. In that scenario the new battery status is dropped from the database and will be absent for clients that load channel state from persisted JSON after reconnect/restart, so the proto addition needs matching JSON serialization/deserialization for these flags.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23390237e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread supla-common/proto.h
// value 1 (0 %) means "OFF"
unsigned char AlarmMuted; // 0 - not used, 1 - alarm is muted, 2 - alarm is
// not muted
unsigned char LocalAlarmIndication; // 0 - not used,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the binary sensor config member name compatible

When building the server code that includes this header, supla-server/src/jsonconfig/channel/binary_sensor_config.cpp and its tests still access TChannelConfig_BinarySensor::AlarmMuted; after this rename the struct no longer has that member, so those targets fail to compile as soon as they include the updated protocol header. Either keep the existing member name or update all users in the same change.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant